<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet"
          href="./bootstrap-3.3.7-dist/css/bootstrap.min.css">

    <script src="./bootstrap-3.3.7-dist/js/jquery-3.1.1.min.js"></script>
    <script src="./layui/layui.all.js"></script>
    <script src="./js/common.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="./bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
    <script src="https://code.angularjs.org/1.4.0-rc.1/angular.js"></script>
    <style type="text/css">
        body {
            background: url(img/main.jpg);
            background-size: 100% 100%;
            background-repeat: no-repeat;
        }

        .content {
            margin: 0 auto;
            margin-top: 270px;
            padding: 20px;
            width: 500px;
            height: auto;
            background: #d0d0d0;
            border-radius: 4px;
            box-shadow: 0 2px 6px rgba(0, 0, 0, .04);
            background-color: rgba(255, 255, 255, 0.3)
        }

        #book {
            margin-top: 20px;
            margin-bottom: 20px;
        }
    </style>
</head>

<body>


<div class="alert alert-info" role="alert">
    <p id="mainhead"></p>
</div>
<div class="content">
    <button type="button" id="book"
            class="btn btn-success btn-lg btn-block" onclick="window.location.href='/createTicket.html'">预定飞机票
    </button>
    <button type="button" id="book"
            class="btn btn-warning btn-lg btn-block" onclick="window.location.href='/listTicket.html'">查看已预定飞机票
    </button>
    <button type="button"
            class="btn btn-danger btn-lg btn-block" id="loginout">退出登录
    </button>
</div>
</body>
<script type="text/javascript">

    $(document).ready(function(){
        checklogin();
    })

    var msg = 'null';
    msg = 'null';
    if (!(msg == 'null')) {
        alert(msg);
    }



    $("#loginout").click(function (e) {
        $.ajax({
            url: 'login/loginout',
            method: 'get',
            dataType: "json",
            traditional: true,
            data: {
            },
            success: function (data) {
                if(data.status == 'ok'){
                    layer.msg(data.msg);
                    window.location.href="/main.html";
                }else{
                    layer.msg(data.msg);
                }
            },
            error: function (data) {

            }
        })
    })
</script>
</html>
